<?php
include_once "Commodity.php";

class Phone extends Commodity
{
    private $brand;             //生产商
    private $origin;            //产地

    function __construct($name,$price,$inventory,$brand,$origin)
    {
        parent::__construct();
        $this->setName($name);
        $this->setPrice($price);
        $this->setInventory($inventory);
        $this->setBrand($brand);
        $this->setOrigin($origin);
    }

    function __destruct()
    {
        parent::__destruct(); // TODO: Change the autogenerated stub
    }

    public function showInfo()
    {
        // TODO: Implement showInfo() method.
        echo "产品名字：".$this->getName()."<br>";
        echo "产品价格：".$this->getPrice()."<br>";
        echo "产品库存：".$this->getInventory()."<br>";
        echo $this->getName()."的品牌是：".$this->getBrand()."<br>";
        echo $this->getName()."的产地是：".$this->getOrigin()."<br>";
    }

    public function getBrand()
    {
        return $this->brand;
    }

    public function getOrigin()
    {
        return $this->origin;
    }

    public function setBrand($brand)
    {
        $this->brand = $brand;
    }

    public function setOrigin($origin)
    {
        $this->origin = $origin;
    }
}